#ifndef _USERSLOTPANEL_H_
#define _USERSLOTPANEL_H_

#include <interfacelib/window/loadcontrol.h>
#include <interfacelib/window/panel.h>

#include <interfacelib/window/editbox.h>

#include "Define/ChannelInfo.h"
#include "Define/ChannelUser.h"

#define			SCRIPT_USER_SLOT_INFO				"UserSlot"
#define			SCRIPT_USER_SLOT_CONTROL			"UserSlotControl"
#define			SCRIPT_USER_SLOT_INFO_ID			"UserID"
#define			SCRIPT_USER_SLOT_INFO_READY		"UserReady"

class FrameChannel;

class UserSlotPanel : public interfacelib::Window::Panel
{
public:
	UserSlotPanel();
	virtual ~UserSlotPanel();

	void setParentFrameChannel( FrameChannel *channel );
	bool create( interfacelib::Window::LoadControl *loadControl , int index );

	void enbleUserInfo( bool enableUserInfo );
	bool isEmptySlot();

	void refresh();
	void setReady( bool ready );
	void setChannelMaster( bool isMaster );

	bool isReady();
	bool isChannelMaster();
	ChannelUser *getInfo();
private:
	void onClickKickOut();

	interfacelib::Window::EditBox *m_editUserID;
	interfacelib::Window::Window *m_windowReady;
//	interfacelib::Window::Window *m_windowIsMaster;
	bool m_isChannelMaster;
	ChannelUser m_channelUser;
	bool m_enableUserInfo;

	FrameChannel *m_frameChannel;


};

#endif